Download Go Source Code & Other Scripts
For source code & scripts, download and extract file go-protobuf-grpc-resources.zip from this lecture's resource
Slides
For certain reason, the slides is not available for download. I'm sorry for the inconvenience.
Install Chocolatey (for Windows)
See installation instruction here
Install Brew (for Mac)
See installation instruction here
Adding PATH variable
Windows
Open Windows Start menu, search for Environment Variables and select Edit the system environment variables.
In the System Properties window, click the Environment Variables button
In the Environment Variables window, scroll down to the System variables section and find the PATH variable. Select it and click the Edit button
Click the New button and enter the path to the folder you want to add to the PATH variable
Click OK to close all windows and apply the changes
Restart terminal / command prompt
Mac with zsh
Open the Terminal application
In the Terminal , type the following command and press Enter to open the zsh configuration file:
nano ~/.zshrc
In the nano editor, add the following line at the end of the file, replacing /path/to/your/folder with the actual path to the folder you want to add to the PATH variable:
export PATH=$PATH:/path/to/your/folder
Press Control + X, then Y, then Enter / Return to save the changes and exit the editor.
To activate the new PATH variable, restart terminal.
Linux with bash shell
Open a terminal window
Open the .bashrc file by typing the following command and pressing Enter:
nano ~/.bashrc
Add the following line at the end of the file, replacing /path/to/your/folder with the actual path to the folder you want to add to the PATH variable:
export PATH=$PATH:/path/to/your/folder
Press Control + X, then Y, then Enter to save the changes and exit the editor.
To activate the new PATH variable, restart terminal.
Rules for Protocol Buffers Schema Evolution
Here are some general rules for ensuring schema compatibility during schema evolution:
Never modify the field number of an existing field. Field numbers are used to identify fields in the encoded data, and changing them can cause compatibility issues.
Never delete an existing field. Instead, mark the field as deprecated and use the reserved keyword to prevent the field number from being reused in the future.
Never change the data type of an existing field. For example, if a field was previously defined as a string, it should not be changed to numeric in the new schema.
Git Repository For Protocol Buffers
This course is using public github repository, so the github action can works without paying
However, my github repository used in the course is not accessible, so you can learn to use github for Go by yourself, following the lessons on the course
You can use either master or main as your default git branch
Github action documentation available here
Git Conventional Commit
See reference here
Github Console Commands
Here are git console commands you will see throughout the course:
git checkout ABCDE : switch to local branch ABCDE
git checkout -b ABCDE : switch to local branch ABCDE, create new ABCDE branch if not exists
git add . : add new files to local git
git commit -am "comment" : commit changes to local git, with specified comment (usually using conventional commit)
git push -u origin ABCDE : push local branch ABCDE to github, create new ABCDE branch on github if not exists
git push : push current branch update to github
git pull : pull latest changes from github
Go Console Commands
Here are the Go console commands you will see throughout the course:
go mod tidy : download required Go dependencies
go get -u ./... : update all dependencies version
Speed Up Protobuf Project Go Library
This usually required during the course if you push a new commit (on project proto) to master or main branch, and new git tag automatically created (e.g. the v0.0.12 is latest tag). Command go get -u ./... will get latest tag registered on pkg.go.dev, but it will takes some times for your latest tag to be updated there.
Instead of waiting pkg.go.dev fetch the latest tag, which can takes minutes, you can fetch the latest tag manually, and use the updated library immediately.
For example, when you need github.com/your-repository/your-proto-project with tag v0.0.12, then:
Update your go.mod file manually for your protobuf library (e.g. github.com/your-repository/your-proto-project), using desired version (in this sample : v0.0.12)
use this command from terminal
go get github.com/your-repository/your-proto-project@v0.0.12
Notes:
Latest tag on pkg.go.dev for the protocol buffers repository on this course's videos (github.com/timpamungkas/my-grpc-proto) is purposedly not valid. That way, you can learn build your own protobuf repository using your own github, hence you can get maximum value from this course.
Go Database